package com.yuxi;

/**
 * 线程优先级和守护线程
 * Created by yuxi on 17/1/26.
 */
public class PriorityAndDeamon {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        Thread thread = new Thread(myThread);
        thread.setPriority(1);
        thread.setName("B");

        Thread thread1 = new Thread(myThread);
        thread1.setName("A");
        thread1.setPriority(10);

        thread.start();
        thread1.start();
    }

    static class MyThread implements Runnable {
        public void run() {
            System.out.println("this is thread name..." + Thread.currentThread().getName());
        }
    }
}
